Methods and Apparatuses for Coding Video Data with Secondary Transform

ABSTRACT

Video processing methods and apparatuses in a video encoding or decoding system for transforming residuals of transform blocks into final transform coefficients or inverse transforming final transform coefficients into residuals. In order to solve the latency issue, exemplary embodiments check if a width or height of a coding block is larger than a predefined threshold, and disable secondary transform or inverse secondary transform for any transform block within the coding block if the width or height of the coding block is larger than the predefined threshold. Another embodiment checks if there are multiple transform blocks in a coding block, and disables secondary transform or inverse secondary transform if the coding block contains multiple transform blocks.

CROSS REFERENCE TO RELATED APPLICATIONS

The present invention claims priority to U.S. Provisional Patent Application, Ser. No. 62/834,487, filed on Apr. 16, 2019, entitled “Secondary transform with smart signaling”, and U.S. Provisional Patent Application, Ser. No. 62/868,023, filed on Jun. 28, 2019, entitled “Secondary transform with TU partition signaling”. The U.S. Provisional Patent Applications are hereby incorporated by reference in their entireties.

FIELD OF THE INVENTION

The present invention relates to video processing methods and apparatuses encode or decode video data in a video coding system. In particular, the present invention relates to encoding or decoding with secondary transform or inverse secondary transform adaptively applied in a transform or inverse transform operation.

BACKGROUND AND RELATED ART

The High-Efficiency Video Coding (HEVC) standard is the latest video coding standard developed by the Joint Collaborative Team on Video Coding (JCT-VC) group of video coding experts from ITU-T Study Group. The HEVC standard relies on a block-based coding structure which splits each video picture into multiple non-overlapped square Coding Tree Units (CTUs). Each individual CTU in a video picture or a slice is processed in a raster scanning order. In the HEVC main profile, the maximum and the minimum sizes of a CTU are specified by syntax elements signaled in the Sequence Parameter Set (SPS). A coded picture may be represented by a collection of slices, and each slice is composed of an integer number of CTUs. A Bi-predictive (B) slice may be decoded using intra prediction or inter prediction with at most two motion vectors and reference indices to predict sample values of each block in the B slice. A Predictive (P) slice is decoded using intra prediction or inter prediction with at most one motion vector and reference index to predict sample values of each block in the P slice. An Intra (I) slice is decoded using intra prediction only.

Each CTU is further recursively partitioned into one or more non-overlapped Coding Units (CUs) using quadtree (QT) splitting structure in order to adapt various local characteristics. At each partition depth of the QT splitting structure, an N×N block is either a single leaf CU or split into four smaller blocks with equal size N/2×N/2. The CTU with the size M×M pixel samples is the root node of a quadtree coding tree, and the four M/2×M/2 blocks are the child quadtree nodes split from the root node. Each of the four M/2×M/2 blocks may become a parent node partitioned by another QT splitting to result in four child nodes with further reduced size by half in each spatial dimension. If a coding tree node is not further split, it is called a leaf CU. The leaf CU size is restricted to be larger than or equal to a minimum allowed CU size, which is also specified in the SPS. An example of a recursive quadtree splitting structure is illustrated in FIG. 1, where the solid lines indicate CU boundaries in the CTU 10.

Once the CTUs are partitioned into leaf CUs, each leaf CU is subject to further split into one or more Prediction Units (PUs) according to a PU splitting type for prediction according to the HEVC standard. Unlike the recursive quadtree splitting for CUs, each leaf CU may only be split once to form one or more PUs. The PU and associated CU syntax work as a basic representative block for sharing prediction information as the same prediction process is applied to all pixel samples in the PU. The prediction information is conveyed to the decoder on a PU basis. After obtaining residuals generated by the prediction process based on the PU splitting type, the residuals belong to a leaf CU is partitioned into one or more Transform Units (TUs) according to a Residual QuadTree (RQT) splitting structure for transforming the residuals into transform coefficients for compact data representation. The dashed lines in FIG. 1 indicate TU boundaries in the CTU 10. The TU is a basic representative block for applying transform and quantization on the residual data or transform coefficients. For each TU, a transform matrix having the same size as the TU is applied to the residuals to generate transform coefficients, and these transform coefficients are quantized and conveyed to the decoder on a TU basis.

The terms Coding Tree Block (CTB), Coding block (CB), Prediction Block (PB), and Transform Block (TB) are defined to specify two-dimensional (2-D) sample array of one color component associated with the CTU, CU, PU, and TU respectively. For example, a TU consists of one luminance (luma) TB, two chrominance (chroma) TBs, and its associated syntax elements in a picture coded with 4:2:0 color format. A similar relationship is valid for CTU, CU, and PU. In the HEVC system, the same quadtree splitting structure is generally applied to both luma and chroma components unless a minimum size for the chroma block is reached.

Joint Video Expert Team (JVET) of ITU-T SG16 WP3 and ISO/IEC JTC1/SC29/WG11 are currently in the process of establishing the next-generation video coding standard Versatile Video Coding (VVC). Various promising coding tools are developed and adopted in the upcoming emerging VVC, for example Transform Skip Mode and Reduced Secondary Transform.

Transform Skip Mode Transform Skip Mode (TSM) is a coding tool processes a quantized residual signal by entropy coding without going through a transform operation. A quantized residual signal of a block coded in TSM is encoded directly in a sample domain instead of transforming into a frequency domain. TSM is found to be particularly beneficial for screen content coding especially for regions with sharp edges and simple colors. In the VVC working draft, TSM is controlled by high level syntax, for example, an enable flag may be used to select TSM on or off, and a syntax element may be used to signal a size constraint for applying TSM. For example, TSM is allowed to be applied to a transform block with a width or height larger than or equal to 32 luma samples. A transform block level flag is signaled to indicate whether TSM is applied to a current transform block when TSM is enabled. Both dependent quantization and sign data hiding are disabled when TSM is enabled for a transform block. Residuals coded in TSM are processed by a separate parsing process.

Reduced Secondary Transform Reduced Secondary Transform (RST) is a new coding tool proposed in VVC to further improve the coding efficiency. RST is also called Low Frequency Non-Separable Transform (LFNST) in some proposals. RST is applied only to intra coded blocks. The main concept of RST is to map an N dimensional vector to an R dimensional vector in a different space, where R is less than N and R/N is the reduction factor. The RST matrix T_(R×N) is an R×N matrix as follows:

$t_{R \times N} = \begin{bmatrix} t_{11} & t_{12} & t_{13} & \ldots & t_{1N} \\ t_{21} & t_{22} & t_{23} & \; & t_{2N} \\ \; & \vdots & \; & \ddots & \vdots \\ t_{R\; 1} & t_{R\; 2} & t_{R\; 3} & \ldots & t_{RN} \end{bmatrix}$

where R rows of the transform are R bases of the N dimensional space. The inverse transform matrix for RST is the transpose of its forward transform matrix. The forward and inverse RST operations are depicted in FIG. 2.

There are two RST types, including RST8×8 and RST4×4 types, selected according to a block size of a current transform block. The RST8×8 type is selected when a minimum of a width and height is larger than or equal to 8 (which means both the width (W) and height (H) of a transform block are greater than 4) and the RST4×4 type is selected when a width or height is smaller than or equal to 4. In an example of the RST8×8 type with a reduction factor of 4 (i.e. ¼ size), a 16×64 RST matrix is used at the encoder side, and a 64×16 inverse RST matrix is used at the decoder side. The input of the16×64 RST matrix is primary transform coefficients in a 8×8 top-left region and the output of the matrix is 16 secondary transform coefficients. The forward RST8×8 type applies 16×64 matrices (or 8×64 matrices for 8×8 blocks) to produce non-zero coefficients only in the top-left 4×4 region within the given 8×8 top-left region. In other words, after applying secondary transform, the top-left 8×8 region except the top-left 4×4 region will only have zero coefficients. In another example of the RST8×8 type, a 16×48 RST matrix is used at the encoder side, and a 48×16 inverse RST matrix is used at the decoder side. The input of the16×48 RST matrix is the first 48 primary transform coefficients, which may be the first three 4×4 sub-blocks, in an 8×8 top-left region and the output of the matrix is 16 secondary transform coefficients. The forward RST8×8 type applies 16×48 matrices (or 8×48 matrices for 8×8 blocks) to produce non-zero coefficients only in the top-left 4×4 region (or the first 8 coefficients, which may be in diagonal scanning, in the top-left 4×4 region or in the whole transform block). In other words, after applying secondary transform, the top-left 8×8 region except for the top-left 4×4 region will only have zero coefficients. For each block selected the RST4×4 type, a 16×16 (or 8×16 matrices for 4×4 blocks) direct matrix multiplication is applied. If both the width (W) and height (H) of a transform block are greater than 4, then the RST8×8 type is applied on primary transform coefficients in the top-left 8×8 region of the transform block. Otherwise if the minimum of the width (W) and height (H) of a transform block are equal to 4, the RST 4×4 type is applied on primary transform coefficients in the top-left 4×4 region of the transform block. Otherwise if the minimum of the width (W) and height (H) of a transform block are less than 4, RST is not applied to the transform block.

An inverse RST is conditionally applied when the following two conditions are satisfied. A first condition is met when a block size is greater than or equal to a given threshold, for example, when a width is larger than or equal to 4 and a height is greater than or equal to 4. A second condition is met when a transform skip mode flag is zero.

A RST index equals to 0 indicating RST is not applied to a current CU, otherwise the RST index indicates which secondary transform kernel is chosen for the current CU. RST is applied for intra CUs in both intra and inter slices. In cases when a dual tree is enabled, RST indices for luma and chroma components are signaled separately. In cases when a dual tree is disabled, for each intra CU in the inter slice, a single RST index is signaled and used for luma or chroma components.

Intra Sub-Partitions (ISP) mode is a new intra prediction mode proposed in VVC. The description of ISP mode is as follows. ISP divides luma intra-predicted blocks vertically or horizontally into 2 or 4 sub-partitions depending on their block sizes. For each sub-partition, reconstructed samples are obtained by adding the residual signal to the prediction signal. Here, a residual signal is generated by the processes such as entropy decoding, inverse quantization and inverse transform. Therefore, the reconstructed sample values of each sub-partition are available to generate the prediction of the next sub-partition, and each sub-partition is processed repeatedly. In addition, the first sub-partition to be processed is the one containing the top-left sample of the CU and then continuing downwards (horizontal split) or rightwards (vertical split). As a result, reference samples used to generate the sub-partitions prediction signals are only located at the left and above sides of the lines. All sub-partitions share the same intra prediction mode. RST is disabled or is conditionally applied for blocks coded by ISP mode. The RST index is not signaled when secondary transform is disallowed for ISP mode. Disabling RST for ISP-predicted residuals can reduce encoding complexity.

RST Selection A secondary transform set for an intra CU is first selected from four transform sets according to a block size and/or an intra prediction mode of the intra CU. Each transform set consist of two transform matrices (also referred to as kernels), and a RST index is used to select one transform matrix from the selected transform set when the RST index is larger than zero. Kernel 1 in the selected transform set is selected when the RST index signaled at the CU level is equal to 1, and kernel 2 in the selected transform set is selected when the RST index signaled at the CU level is equal to 2. The corresponding intra prediction mode for luma component is used to select the transform set if one of three Cross Component Linear Model (CCLM) modes for chroma components is indicated. The transform set selection is based on the intra prediction mode as shown in Table 1.

TABLE 1 Transform set selection table IntraPredMode Transform Set Index IntraPredMode < 0 1 0 <= IntraPredMode <= 1 0 2 <= IntraPredMode <= 12 1 13 <= IntraPredMode <= 23 2 24 <= IntraPredMode <= 44 3 45 <= IntraPredMode <= 55 2 56 <= IntraPredMode 1

The index IntraPredMode in Table 1 is the intra prediction mode number of the current CU, which has a range of [−14, 83] including regular intra directional modes and wide angle intra prediction modes.

Simplification of RST A simplification method limits a worse case number of multiplications per sample to be less than or equal to 8. For example, worse cases in terms of multiplication counts for the RST8×8 and RST4×4 types occur when all TUs consist of 4×4 TU or 8×8 TU. Top 8×64 and 8×16 matrices, in other words, first 8 transform basis vectors from the top in each matrix, are applied to the 8×8 TU and 4×4 TU, respectively. In the case of a TU larger than 8×8, the worse case does not occur so that one of 16×64 matrices (i.e. RST8×8 type) is applied to the top-left 8×8 region of the TU. For an 8×4 or 4×8 TU, one of 16×16 matrices (i.e. RST 4×4) is applied to only the top-left 4×4 region excluding other 4×4 regions in the top-left 8×8 region in order to avoid worse case happening. In the case of processing a 4×N or N×4 TU (where N is larger than or equal to 16), the RST 4×4 type is applied to one or each of two adjacent top-left 4×4 blocks. With the aforementioned simplification, the worse case number of multiplication counts becomes 8 multipliers per sample.

RST Matrices of Reduced Dimension To reduce the storage requirement and the computational complexity, RST matrices with reduced dimension such as16×48 matrices are applied instead of 16×64 matrices with the same transform set configuration. Each 16×48 matrix takes 48 input primary coefficients from three 4×4 regions in a top-left 8×8 region excluding the bottom-right 4×4 region. FIG. 3 illustrates an example of applying both primary and secondary transform to an M×N transform block. The M×N residual block 32 is processed by 2D forward primary transform to generate M×N primary coefficients 34, where N and M are larger than 8 in this example. The first three 4×4 regions in the top-left 8×8 region of the M×N primary coefficients 34 are further processed by forward secondary transform using a 16×48 kernel. The coefficients in the resulting block 36 are filled with 0, except for the first subblock 362 in the top-left 8×8 region of the resulting block 36. The 16 output secondary coefficients of the 16×48 kernel are stored in the top-left 4×4 subblock 362, while coefficients of the other subblocks in this transform block are reset to zero after secondary transform. With the reduced dimension design, memory usage for storing all RST matrices is reduced from 10 KB to 8 KB with a reasonable performance drop. As a result, 16×48 and 8×48 transform matrices are employed for the RST8×8 type and 16×16 and 8×16 transform matrices are employed for the RST4×4 type. Since there are 4 transform sets and each transform set contains 2 transform matrices, 8 different 16×48 matrices and 8 different 16×16 matrices are available for secondary transform. Each 8×48 matrix is derived by a corresponding 16×48 matrix, and similarly, each 8×16 matrix is derived by a corresponding 16×16 matrix. For example, an 8×48 matrix is just the top 8 rows of the corresponding 16×48 matrix. For example, an 8×16 matrix is just the top 8 rows of the corresponding 16×16 matrix. The 8×48 matrices are used for secondary transform of 8×8 TBs and 8×16 matrices are used for secondary transform of 4×4 TBs. In cases when the TB size is equal to 8×4 or 4×8, a 16×16 matrix is applied to only the top-left 4×4 subblock, so that the other 4×4 subblock is ignored for secondary transform. In cases when the TB size is 4×N or N×4 where N is greater than or equal to 16, a 16×16 matrix is applied to the first one or two adjacent 4×4 subblocks. For other TBs with both the width and height greater than or equal to 8, a 16×48 matrix is applied to the top-left 8×8 region.

RST Signaling As previously described, a RST index is used to indicate if secondary transform is applied and to select a secondary transform matrix from a corresponding transform set. The RST index is signaled at a CU level after signaling TU syntax. In an example of RST, the forward RST8×8 with 16 rows of transform (i.e. R=16) uses 16×64 or 16×48 matrices to generate non-zero coefficients only in the top-left 4×4 region within the given top-left 8×8 region. In other words, if RST is applied, the 8×8 region except for the top-left 4×4 region contains only zero coefficients. As a result, an RST index is not signaled nor parsed when any non-zero element is detected within the top-left 8×8 block region other than the top-left 4×4 region because it implies that RST is not applied. The RST index is inferred to zero if it is not signaled. FIG. 4 illustrates an example of scanning the 64^(th) position to the 17^(th) position in an 8×8 region of a transform block for any non-zero coefficient in order to detect whether RST is applied in the transform block. In another example of RST, the forward RST8×8 with 16 rows of transform (i.e. R=16) uses 16×64 or 16×48 matrices to generate non-zero coefficients only in the top-left 4×4 region. In other words, if RST is applied, except for the top-left 4×4 region, the transform block contains only zero coefficients. As a result, an RST index is not signaled nor parsed when any non-zero element is detected within the transform block other than the top-left 4×4 region because it implies that RST is not applied. The RST index is inferred to zero if it is not signaled.

After signaling the syntax for each TU within one CU, secondary transform syntax, such as a RST index, is signaled at a CU level. The syntax for each TU may include signaling of a last significant coefficient for a TU and signaling of a significant flag for each coding group in a TU. For a coding group, where the last significant coefficient is located, the significant flag for that coding group needs not to be signaled and is inferred to be true. For a luma component, a coding group can be a 4×4 subblock in one TU or can be smaller subblock when ISP is selected. For chroma components, a coding group can be a 4×4 sub-block for an intra slice and a 2×4/4×2/4×4 sub-block for an inter slice.

Currently, secondary transform is only performed on intra blocks for both luma and chroma components. The value of a secondary transform index is from 0 to n, for example, n is 2. The secondary transform index equal to zero indicates the secondary transform is not applied. The RST index is signaled with truncated unary codes. For an example, the first bin is context coding and the second bin is bypass coding. For another example, the first and second bins are context coding.

BRIEF SUMMARY OF THE INVENTION

Methods and apparatuses of video processing in a video encoding system for encoding video data in video pictures comprise receiving input data associated with a current block in a current video picture, generating residuals of the current block by predicting the current block, determining that a width or height of the current block is larger than a predefined threshold, determining and applying a transform operation for the current block to generate final transform coefficients, and encoding the current block. The transform operation excludes secondary transform. In cases when the width and height of a block are less than or equal to the predefined threshold, the video encoding system determines whether secondary transform is applied to the block, and accordingly applies primary transform or both primary and secondary transform to the residuals of the block to generate final transform coefficients. After generating the final transform coefficients, each block is encoded according to the final transform coefficients of the current block. According to some embodiments, the current block is predicted by intra prediction as secondary transform is disabled for non-intra coded blocks. Some embodiments of the video encoding system only apply secondary transform to TUs in intra coded blocks as secondary transform is disabled for non-intra coded blocks

An index is signaled for the current block indicating whether secondary transform is applied to the current block according to an embodiment, and the index for the current block is forced to zero. In some embodiments of the present invention, the current block is a CU, and the video encoding system further determines the transform operation excludes secondary transform based on a number of TU(s) in the current block, for example, the transform operation excludes secondary transform when the number of TUs in the current block is larger than one indicating there are multiple TUs in the current block.

In some specific embodiments, the video encoding system only applies secondary transform to one selected TU within the current block and skips secondary transform to all other TUs within the current block when the width or height of the current block is larger than the predefined threshold or when there are multiple TUs in the current block. For example, the video encoding system determines a transform operation for other TUs and an auxiliary transform operation for one selected TU, where the transform operation comprises only primary transform and the auxiliary transform operation comprises both primary and secondary transform. The selected TU is a last TU within the current block according to an embodiment.

Some examples of the predefined threshold include 16, 32, 64, 128, and 256 luma samples. The current block is a CU, CB, TU, or a TB, and the predefined threshold of some embodiments is set according to a maximum TU size or a maximum TB size, and the maximum TU size or maximum TB size is specified by a coding standard, such as 64 luma samples, or the maximum TU size is specified in a Sequence Parameter Set (SPS), Picture Parameter Set (PPS), tile, tile group, or slice level.

An embodiment of the video encoding system signals a secondary transform index indicating whether secondary transform is applied to the current block only when both the width and height of a block are less than or equal to the predefined threshold. In other words, this secondary transform index is not signaled for the current block as the current block has a width or height larger than the predefined threshold. When the secondary transform index is not signaled, the secondary transform is inferred as disabled (i.e. secondary transform index is set to zero). In an alternative embodiment, the video encoding system signals a secondary transform index for the current block, however, the secondary transform index is forced to zero.

In another embodiment, a constraint is set to limit the size of the intra or inter CUs so both the width and height of the CUs are not larger than the predefined threshold. For example, the width and height of a CU are restricted to be smaller than or equal to the predefined threshold in order for the CUs to be processed by secondary transform. A block is forced to partition into multiple CUs with widths and heights less than or equal to the predefined threshold if the width or height of the block is larger than the predefined threshold. The video encoding system determines and applies a transform operation on the TU within each CU split from the block and encodes each CU split from the current block.

Embodiments of a video decoding system comprise receiving input data associated with a current block in a current video picture, decoding the input data to determine final transform coefficients of the current block, determining that a width or height of the current block is larger than a predefined threshold, determining and applying an inverse transform operation to the final transform coefficients to recover residuals of the current block, and decoding the current block based on the residuals. The inverse transform operation for the current block excludes inverse secondary transform.

According to some embodiments, the current block is coded by intra prediction as secondary transform is always disabled for non-intra coded blocks. A secondary transform index for the current block is inferred to be zero as the width or height of the current block is larger than the predefined threshold. In some embodiments, the current block is a CU, and the inverse transform operation excludes inverse secondary transform based on a number of TU(s) in the current block. For example, the transform operation excludes secondary transform when the number of TUs in the current block is larger than one, indicating there are multiple TUs in the current block. In one embodiment, the video decoding system parses a secondary transform index associated with the current block however the secondary transform index is forced to be zero.

In one embodiment, the video decoding system applies inverse secondary transform and inverse primary transform to one selected TU within the current block and only applies inverse primary transform to all other TUs within the current block. For example, the video decoding system determines an inverse transform operation for all other TUs and an auxiliary inverse transform operation for one selected TU, where the inverse transform operation comprises only inverse primary transform and the auxiliary inverse transform operation comprise both inverse secondary transform and inverse primary transform. The selected TU is a last TU within the current block in a decoding order according to an embodiment.

Some examples of the predefined threshold include 16, 32, 64, 128, and 256 luma samples. In some embodiments, the predefined threshold is set according to a maximum TU size or a maximum TB size, for example, the maximum TU size or maximum TB size is specified by a coding standard, or the maximum TU size is specified in a SPS, PPS, tile, tile group, or slice level.

In one embodiment, the video decoding system only parses a secondary transform index indicating whether inverse secondary transform needed to be applied if the width and height of a block are less than or equal to the predefined threshold. The secondary transform index for the current block is inferred to be zero as the width or height of the current block is larger than the predefined threshold. In another embodiment, the video decoding system parses a secondary transform index regardless the width and height of a block, however the parsed secondary transform index is equal to zero if the width or height of the block is larger than the predefined threshold.

In another embodiment, a constraint is set to restrict the size of each CU if secondary transform is to be applied to the TU in each CU. In this embodiment, a block is split into multiple CUs with widths and heights less than or equal to the predefined threshold if the width or height of the block is larger than the predefined threshold. The video decoding system parses a secondary transform index, determines and applies an inverse transform operation for the TU in each CU to recover residuals, and then decodes each CU based on the recovered residuals.

Aspects of the disclosure further provide an apparatus implemented in a video encoding system or a video decoding system, and the apparatus disables secondary transform or inverse secondary transform if a width or height of a current block is larger than a predefined threshold. In some embodiments, a secondary transform index for the current block is not signaled by the video encoding system and is inferred to be zero by the video decoding system if the width or height of the current block is larger than the predefined threshold. In an alternative embodiment, the secondary transform index for the current block is still signaled in or parsed from the video bitstream even if the width or height is larger than the predefined threshold, but the value is forced to be zero. Other aspects and features of the invention will become apparent to those with ordinary skill in the art upon review of the following descriptions of specific embodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

Various embodiments of this disclosure that are proposed as examples will be described in detail with reference to the following figures, wherein like numerals reference like elements, and wherein:

FIG. 1 illustrates an exemplary coding tree for splitting a Coding Tree Unit (CTU) into Coding Units (CUs) and splitting each CU into one or more Transform Units (TUs) according to a quadtree splitting structure.

FIG. 2 illustrates simplified block diagrams of secondary transform and inverse secondary transform operations.

FIG. 3 illustrates applying forward primary transform and secondary transform to residuals of an M×N transform block to generate final transform coefficients.

FIG. 4 illustrates an example of scanning the 64^(th) position to the 17^(th) position in a transform block for any non-zero element.

FIG. 5 is a flowchart illustrating a video encoding method of setting a constraint for applying secondary transform for encoding a current block according to an embodiment of the present invention.

FIG. 6 is a flowchart illustrating a video decoding method of setting a constraint for applying inverse secondary transform for decoding a current block according to an embodiment of the present invention.

FIG. 7 illustrates a 16×16 transform block within a 16×16 CU for demonstrating some embodiments of applying secondary transform to the 16×16 transform block.

FIG. 8 illustrates an exemplary system block diagram for a video encoding system incorporating a video processing method according to embodiments of the present invention.

FIG. 9 illustrates an exemplary system block diagram for a video decoding system incorporating a video processing method according to embodiments of the present invention.

FIG. 10 illustrates an example of the processing order for a 16×16 transform block.

DETAILED DESCRIPTION OF THE INVENTION

It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention.

Various methods described in the present invention are aimed to improve the efficiency of secondary transform signaling or to reduce the decoding latency. At an encoder side, a current block, such as a CU, is first predicted by a prediction operation to generate a predictor. Residuals of the current block are generated according to the predictor. A transform operation, including one or both primary transform (e.g. DCT-II) and secondary transform, is applied to determine final transform coefficients. A quantization process is then applied to the final transform coefficients before entropy encoding into a video bitstream. The residuals after the primary transform are referred to as temporary transform coefficients or primary transform coefficients, and the temporary transform coefficients are processed by secondary transform to generate the final transform coefficients of the current block. If secondary transform is not applied to the current block, the temporary transform coefficients are assigned as the final transform coefficients of the current block. If primary transform is not applied, the residuals processed by secondary transform are the final transform coefficients of the current block. At a decoder side, a video bitstream is decoded to derive coefficient levels associated with a current block, and the coefficient levels are inverse quantized to generate final transform coefficients. If a secondary transform index associated with the current block is larger than zero and the conditions for applying secondary transform are satisfied (e.g. the width and height of the current transform block are larger than 4), inverse secondary transform is first applied to the final transform coefficients to determine temporary transform coefficients. Inverse primary transform is then applied to the temporary transform coefficients to recover residuals. Only inverse primary transform is applied to the current block to recover the residuals if the secondary transform index associated with the current block is equal to zero. A reconstructed block is then obtained according to the residuals and a corresponding predictor of the current block.

Setting Constraint for Applying Secondary Transform According to the recent secondary transform signaling design, a video decoder can only decide a secondary transform index, such as a RST index or a LFNST index, after the coefficients for all TBs in one CU are parsed. The video coding standard under development tends to support 64×64 pipeline processing; and the latency issue of secondary transform occurs when processing a CU with a size larger than 64×64 samples. Various embodiments of the present invention set a constraint to handle the latency issue caused by secondary transform signaling. In the recent development, secondary transform is only applied to intra coded blocks, so the current block in the following embodiments is an intra coded block. However, the current block in the following embodiments may not necessary to be an intra coded block if secondary transform can be enabled for non-intra predicted blocks. To avoid the undesired latency caused by secondary transform signaling, secondary transform cannot be applied on the transform block(s) in a CU when a width or height of the CU is larger than a predefined threshold. In some embodiments, the width or height of the CU is measured in a number of luma samples in the luma CB within the CU. Some examples of the predefined threshold are 16, 32, 64, 128, and 256 luma samples. For example, residuals of a current block are not processed by secondary transform if any of a width or height of the current block is larger than 64 samples, so any block with a size larger than 64×64 is not processed by secondary transform. In one embodiment, the predefined threshold is set according to a maximum TU size or a maximum TB size (i.e. MaxTbSizeY) specified in the video coding standard, for example, the maximum TB size in the video coding standard under development is 64 luma samples. In yet another embodiment, the predefined threshold is adaptively determined according to a maximum TU size or a maximum TB size, which is derived from a value signaled in a Sequence Parameter Set (SPS), Picture Parameter Set (PPS), tile, tile group, or slice level. For example, a maximum TB size (MaxTbSizeY) is set as 1<<sps_max_luma_transform_size_64_flag signaled at SPS. A secondary transform index for a current block is set to be zero when the current block has a width or height larger than the predefined threshold, and this secondary transform index is signaled by the encoder and parsed by the decoder in one embodiment, or this secondary transform index is not signaled by the encoder and is inferred to be zero by the decoder in an alternative embodiment. For example, the video encoder signals a secondary transform index for every intra coded CU to indicate whether secondary transform is applied, and if it is applied, the secondary transform index also indicates which matrix is selected by the encoder. A corresponding video decoder in this embodiment parses a secondary transform index for each intra coded CU to determine whether inverse secondary transform needed to be applied. The video decoder may check a width or height of each intra coded CU with the predefined threshold for bitstream conformance as the secondary transform index for any intra coded CU has to be zero when the width or height of the intra coded CU is larger than the predefined threshold. In the alternative embodiment, the secondary transform index is not signaled at the encoder side for any intra coded CU having a CU width or height larger than the predefined threshold, and the secondary transform index is inferred as zero at the decoder side. In the above embodiments, the current block is the current CU. The current block may be a luma Coding Block (CB) containing one or more luma TBs. The current block may be a chroma CB containing one or more chroma TBs. The current block may be a luma or chroma TB. The current block may be a TU.

In some embodiments, a transform operation or inverse transform operation for one or more TUs in a current CU excludes secondary transform or inverse secondary transform based on a number of TUs in the current CU. For example, the transform operation excludes secondary transform when the number of TUs in the current CU is larger than one, and the inverse transform operation excludes inverse secondary transform when the number of TUs in the current CU is larger than one. In other words, secondary transform is disabled for a current CU when there are multiple TUs existed in the current CU (which means the width or the height of the current CU/CB are larger than the maximum TU/TB size). A secondary transform index for a current CU is forced to be zero or inferred as zero when this current CU is splitting into multiple TUs. For example, when a CU can be processed by secondary transform, a secondary transform index is signaled regardless whether this CU is further split into multiple TUs. The corresponding decoder parses the secondary transform index for the CU, but forces the secondary transform index to be zero if this CU is split into multiple TUs. In another example, a secondary transform index is not signaled when a CU is split into multiple TUs, and thus the decoder does not parse the secondary transform index and directly infers the secondary transform index as zero. An exception is that an ISP-applied luma CB (in a luma splitting tree, also called a CU) may be divided into multiple luma TBs (in a luma splitting tree, also called TUs) even if the width and height of the luma CB are not larger than the maximum TB size. In this case, secondary transform can be used when multiple TUs exist in a CU. In another embodiment, secondary transform cannot be applied to any CU with a width or height larger than a predefined threshold nor any CU split into multiple TUs. For example, a secondary transform index for a current CU is still signaled or parsed but is forced to be zero when this current CU is splitting into multiple TUs, or when a CU width is larger than a maximum TU width and/or a CU height is larger than a maximum TU height. Alternatively, the secondary transform index is not signaled at the encoder side when a current CU is split into multiple TUs or when a CU width or CU height is larger than a predefined threshold, and the secondary transform index for this current CU is inferred as zero in the decoder side.

For example, a constraint is set to skip signaling a secondary transform index for a CU splitting into multiple TUs. A CU is forced to split into multiple TUs when at least one of the following is true: a CU width is larger than a maximum TU width (or maximum TU or TB size), a CU height is larger than a maximum TU height (or maximum TU or TB size), or a CU size is larger than a maximum TU or TB size specified in the standard or in a SPS, PPS, tile, tile group, or slice level. Accordingly, a secondary transform index is not signaled nor parsed for a current CU when the current CU will be split into multiple TUs. The secondary transform index for the current CU is simply inferred to be zero when the current CU will be split into multiple TUs.

In some other embodiments of the present invention, a constraint restricts applying secondary transform or inverse secondary transform to only one selected TU within a current CU when a width or height of the current CU is larger than a predefined threshold or when the current CU contains multiple TUs. That is only the selected TU within the current CU can be processed by secondary transform when the current CU contains multiple TUs. The transform operation including secondary transform or the inverse transform operation including inverse secondary transform for the selected TU may follow the current design. For example, in an encoder side, a transform operation including only primary transform is applied to all other TUs in the current CU, whereas an auxiliary transform operation including both primary transform and secondary transform is applied to the selected TU. In a decoder side, an inverse transform operation including only inverse primary transform is applied to all other TUs in the current CU, whereas an auxiliary transform operation including both inverse secondary transform and inverse primary transform is applied to the selected TU. Some examples of the predefined threshold is set according to the maximum TU size specified by the video coding standard or adaptively determined in a SPS, PPS, tile, tile group, or slice level. In an embodiment of implementing this constraint, the selected TU is a last TU within the current CU according to a decoding order. In comparison to applying secondary transform on one of other TUs, applying second transform on the last TU leads to less latency.

Some other embodiments set a constraint to restrict a maximum width, height, or size of an intra or inter CU. For example, in order to apply secondary transform to intra coded CUs, the width or height of each intra coded CU cannot exceed a predefined threshold. The predefined threshold may be 16, 32, 64, 128, or 256 samples. In one embodiment, the predefined threshold is set according to a maximum TU size specified in the corresponding standard, such as 64 luma samples, and in another embodiment, the predefined threshold is adaptively determined according to a maximum TU size specified in a SPS, PPS, tile, tile group, or slice level. By implementing this constraint, each intra coded CU only contains one TU as the width and height of all the intra CUs are smaller than or equal to the maximum TU size.

Any of the foregoing embodiments implemented in a decoder may implicitly decide whether secondary transform is disabled according to a block width, block height, or block area, or explicitly decided by a secondary transform flag signed at CU, CTU, slice, tile, tile group, SPS, or PPS level.

Exemplary Flow Charts for Embodiments of Constraining Secondary Transform FIG. 5 is a flowchart illustrating an exemplary embodiment of a video encoding method implementing a constraint for applying secondary transform in a video encoding system. The video encoding system in this exemplary embodiment processes residuals associated with a current block by a transform operation, where the residuals associated with the current block is partitioned into one or more Transform Units (TUs), and each TU is composed of luma and chroma Transform Blocks (TBs). Secondary transform is applied to luma and/or chroma components of intra blocks in this exemplary embodiment. The exemplary embodiment of the video encoding system first receives input data associated with a current block in a current video picture in step S502, and determines if the current block is to be encoded by intra prediction in step S504. The video encoding system generates residuals of the current block after applying intra prediction in step S506 if the current block is determined to be encoded by intra prediction in step S504. The video encoding system generates residuals of the current block after applying non-intra prediction in step S508 if the current block is determined to be encoded by non-intra prediction in step S504. Some examples of non-intra prediction include Merge prediction, Skip prediction, affine motion compensation prediction, and subblock-based temporal motion vector prediction. In cases when the current block is encoded by Skip mode, there is no residual associated with the current block needed to be further processed. In this embodiment, secondary transform can only be enabled for a current block coded by intra prediction; however, steps S504, 506, and 508 may be skipped or modified if secondary transform can be applied to blocks coded by other prediction method. After step S508, the residuals of the current block are processed by primary transform to generate final transform coefficients in step S512 as secondary transform is not enabled for non-intra predicted blocks. After obtaining residuals of the current block in step S506, one or both of width and height of the current block is compared with a predefined threshold in step S510, and if the width or height of the current block is larger than the predefined threshold, the video encoding system applies primary transform to the residuals of the current block to generate final transform coefficients in step S512. If the width and height of the current block are less than or equal to the predefined threshold, the video encoding system further determines if secondary transform is needed for the current block in step S514, if secondary transform is applied, the video encoding system performs a transform operation comprising both primary transform and secondary transform to the residuals of the current block to generate final transform coefficients in step S516, otherwise, the video encoding system performs a transform operation comprising only primary transform to the residuals of the current block in step S512. In some embodiments of the present invention, the predefined threshold is set to equal to a maximum TU size such as 64 luma samples. In one embodiment of step S510, the video encoding system also checks if there are multiple TUs in the current block, and proceeds to step S512 if either the width or height is larger than the predefined threshold or the current block has multiple TUs. In some other embodiments, step S510 is replaced by checking if there are multiple TUs in the current block. After obtaining the final transform coefficients in step S512 or step S516, the video encoding system encodes the current block according to the final transform coefficients in step S518. In cases when Transform Skip Mode (TSM) is enabled and selected by the current block, both primary transform and secondary transform are disabled, so steps S510, S512, S514, and S516 are skipped as the residuals of the current block are encoded directly in a sample domain instead of transforming into a frequency domain in step S518.

FIG. 6 is a flowchart illustrating an exemplary embodiment of a corresponding video decoding method implemented in a video decoding system. Input data associated with a current block in a current video picture are received in step S602. The video decoding system determines if a prediction mode for the current block is intra prediction in step S604, and if so, final transform coefficients of the current block are decoded in step S606; otherwise final transform coefficients of the current block are parsed and decoded in step S608. Since secondary transform is disabled for CUs coded in non-intra prediction in this embodiment, the video decoding system performs an inverse transform operation comprising only inverse primary transform on the final transform coefficients to recover residuals of the current block in step S612. After step S606, the video decoding system compares one or both of a width and height of the current block with a predefined threshold in step S610, and proceeds to step S612 if the width or height of the current block is larger than the predefined threshold or proceeds to step S614 if the width and height are less than or equal to the predefined threshold. In another embodiment, the video decoding system checks if there are multiple TUs in the current block instead of comparing the width and height in step S610. In one embodiment, the video decoding system checks for both, and proceeds to step S612 if either the width or height is larger than the predefined threshold or the current block has multiple TUs. In step S612, an inverse transform operation comprising inverse primary transform is performed on the final transform coefficients to recover residuals of the current block. In cases when the width and height are smaller than or equal to the predefined threshold, the video decoding system parses a secondary transform index associated with the current block and checks if this secondary transform index is equal to zero in step S614. If the secondary transform index is not equal to zero, for example the secondary transform index is equal to one or two, indicating secondary transform was applied to the current block in the encoder side, the video decoding system applies inverse secondary transform then inverse primary transform to the final transform coefficients to recover residuals of the current block in step S616. If the secondary transform index is equal to zero, indicating secondary transform was not applied to the current block in the encoder side, the video decoding system applies only inverse primary transform to the final transform coefficients to recover residuals in step S612. The current block in the current video picture is decoded based on the residuals of the current block in step S618 after recovering the residuals in step S612 or step S616. The exemplary embodiment illustrated in FIG. 6 infers the secondary transform index to be zero when the checking result of step S610 is true. In the corresponding video encoder, the secondary transform index associated with a current CU may be or may not be signaled in the video bitstream when the width or height of the current CU is larger than the predefined threshold or when there are multiple TUs in the current CU according to various embodiments. If the secondary transform index is always signaled for all intra coded CUs, the video decoder can always parse the secondary transform index to determine which transform process was applied, and step S610 can double check the validity of the parsed secondary transform index.

Signaling Modification for Secondary Transform In order to solve the latency issue caused by the conventional design of secondary transform signaling, some embodiments of the present invention modify the current secondary transform signaling design. In some embodiments, the secondary transform syntax, such as the RST index or the LFNST index, is signaled at a TU level instead of at a CU level. For example, the secondary transform index is signaled at the end of a TU according to an embodiment. In another embodiment, the secondary transform index for a TU is signaled after signaling a last significant coefficient at a TB level, and then syntax elements for this TU, such as the significant flag for each coding group in each TB are signals. In other words, the secondary transform syntax at a TU level is signaled before syntax elements of a next TU in the scanning order. In yet another embodiment, the secondary transform index is signaled before reconstructing the coefficients for each coefficient group. In cases when there are multiple TUs in a current CU, a secondary transform index for the current CU is signaled in at least one of the TUs. For example, the secondary transform index is signaled in a first TU of the current CU. Secondary transform can only be applied to the first TU of a current CU as secondary transform is not allowed in the following TUs of the current CU according one embodiment. In another embodiment, the signaled secondary transform index is shared with all TUs in the current CU. For example, the transform operation or inverse transform operation is applied to the following TUs according to the shared secondary transform index that is signaled in the first TU. In another example, a number of non-zero coefficients in each TU is compared with a threshold, and the TU can only apply secondary transform or inverse secondary transform according to the shared secondary transform index if the number of non-zero coefficients is larger than the threshold. In an alternative embodiment, a secondary transform index is signaled at each of the first N TUs of a current CU, where N is selected from 1 to a total number of TUs in the current CU. In yet another embodiment, the secondary transform index is signaled in a last TU within the current CU because performing secondary transform on the last TU leads to less latency compared to performing secondary transform on any other TU.

In some embodiments of secondary transform syntax signaling, after signaling the last significant coefficient at a TB level, a syntax element for secondary transform, such as the secondary transform index, is signaled. The remaining syntax elements for the TB, such as the significant flag for each coding group in the TB, are signaled. One of the embodiments of the video encoder signals a secondary transform index at a TB level after signaling the last significant coefficient at the TB level, and then signals the remaining syntax elements for the TB. In one embodiment, secondary transform syntax at a TU level is signaled after signaling the last significant coefficient at a TB level, and the syntax for a TU, such as the significant flag for each coding group in each TB, is then signaled. For example, the coding group contains 4×4 samples.

In another embodiment, secondary transform syntax at a CU level is signaled after signaling the last significant coefficient at the TU level, and the syntax for a TU, such as signaling of the significant flag for each coding group in the TU, is then signaled.

In an embodiment, secondary transform syntax for a current CU, such as a RST index or LFNST index, is signaled in a first available TU in a current CU. In this embodiment, a current CU has a first available TU if both a constraint for secondary transform signaling is satisfied and secondary transform is allowed for the current CU. An example of the constraint for secondary transform signaling is depending on a position of a last significant coefficient of a TU. In another example, the constraint for secondary transform signaling only signals secondary transform syntax when a number of non-DC values in transform coefficients is larger than a predefined number. Some other examples of the constraint for secondary transform signaling will be described in the later sections. An example of allowing secondary transform is when the current CU is an intra coded CU. For each of the remaining TUs other than the first available TU within the current CU, secondary transform syntax is not signaled and is inferred to be the same as the secondary transform syntax of the first available TU according to one embodiment. That is, the remaining TUs share the secondary transform syntax with the first available TU. In this embodiment, if the constraint for secondary transform signaling is not satisfied in any remaining TU in the current block, secondary transform or inverse secondary transform will not be applied to this remaining TU regardless of the secondary transform syntax of the first available TU in the current block. In one example, if a first available TU cannot be found in a current CU for secondary transform, secondary transform will not be applied to any TU in this current CU. In another embodiment, secondary transform or inverse secondary transform is only applied to the first available TU within a current CU and not applied to the remaining TUs within the current CU.

In some embodiments, the constraint is checked with every TU within a current CU, and each TU satisfying the constraint shares the same secondary transform syntax. For example, secondary transform or inverse secondary transform can be applied to all TUs in a current CU if all the TUs satisfy the constraint for secondary transform signaling. In another embodiment, the constraint is also checked with every TU within a current CU, but secondary transform or inverse secondary transform is only applied to one or more TUs in the current CU if all TUs satisfy the constraint. Secondary transform or inverse secondary transform cannot be applied to TUs in a current CU if any TU in the current block is not available for secondary transform as the constraint for secondary transform signaling is not satisfied.

Secondary Transform Signaling based on Last Significant Coefficient The constraint for secondary transform signaling mentioned in various previously described embodiments can be set according to one or more last significant coefficients of one or more transform blocks according to some embodiments of the present invention. Embodiments of the constraint for secondary transform signaling are related to one or more positions of the last significant coefficients of one or more transform blocks. The encoder signals syntax associated with a last significant coefficient position for each transform block indicating the position of the last significant coefficient in the transform block. The decoder determines a position of a last significant coefficient in each transform block by parsing syntax associated with a last significant coefficient position for each transform block. For example, the syntax associated with the last significant coefficient position includes last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix.

In the conventional RST signaling design, the encoder or decoder checks if there is any non-zero coefficient within a zero-out region of secondary transform, which means the coefficients after secondary transform or before inverse secondary transform are zero, and skips signaling or parsing the secondary transform index if at least one non-zero coefficient is found in the zero-out region of secondary transform. Embodiments of the present invention simplify this checking process for secondary transform signaling by only checking a TB level syntax element for each considered TB. FIG. 7 illustrates a 16×16 TU within a 16×16 CU for demonstrating various embodiments of secondary transform signaling according to a last significant coefficient signaled at a TB level. FIG. 7 illustrates a luma (luminance) Transform Block (TB) of the 16×16 TU, where the two chrominance (chroma) TBs of the 16×16 TU are not shown for brevity. In some embodiments of secondary transform signaling, a secondary transform index such as the RST index or LFNST index, is adaptively signaled for a current block according to a position of a last significant coefficient in each TB in the current block. For example, a current block is a luma CB containing one or more luma TBs or the current block is a chroma CB containing one or more chroma TBs, and a secondary transform index is conditionally signaled according to one or more positions of the last significant coefficients in the luma or chroma TB(s). For another example, a current block is a CU and a secondary transform index is adaptively signaled for one or more luma TBs in a current CU according to positions of last significant coefficients in one or more luma TBs, and this secondary transform index is shared by the luma and chroma TBs in the current CU. In another example, a current block is a CU contains one or more luma TBs and one or more chroma TBs, and a secondary transform index is conditionally signaled according to one or more positions of the last significant coefficients in one or both the luma and chroma TBs. Secondary transform is only applied to one or more luma or chroma TBs. The secondary transform index is assumed to be signaled at a CU level or after parsing all TBs in the current block in the following embodiments; however, these embodiments can also be implemented with the secondary transform index signaled in a TB level (e.g. signaled after parsing the coefficients in the current TB or signaled after parsing the last significant coefficient positions in the current TB) or a TU level (or after parsing the TBs within the current TU). For example, the secondary transform index for a current CU is signaled at a CU level after all TBs in the current CU. In cases when secondary transform is applied to this 16×16 CU, a 16×48 matrix multiplication is applied to the 16×16 transform block within the 16×16 CU using a selected secondary transform kernel. Each coding group in these embodiments is a 4×4 subblock in the transform block. The first, second, third, and fourth coding groups within a top-left 8×8 region of the transform block are denoted as CG 0, CG 1, CG 2, and CG 3. The corresponding significant flags for CG 0, CG 1, CG 2, and CG 3 are denoted as SigFlagCG0 SigFlagCG1, SigFlagCG2, and SigFlagCG3 respectively. In the video encoder, the 16×16 TU is first processed by primary transform to generate primary transform coefficients, and the 48 primary transform coefficients in the first three coding groups CG 0, CG 1, CG 2 are the input of secondary transform. The 48 primary transform coefficients are multiplied with a selected 16×48 matrix to generate 16 secondary transform coefficients. After applying secondary transform, coefficients in the first coding group CG 0 are set to equal to the generated16 secondary transform coefficients, while all remaining coefficients in the transform block are set to zero according to one embodiment. In cases when secondary transform is not applied, the second, third and fourth coding groups CG 1, CG 2, CG 3 and/or the remaining region in the transform block may contain non-zero coefficients. The region having all transform coefficients set to zero after secondary transform is referred to as a zero-out region of secondary transform.

Instead of searching for non-zero coefficients within a zero-out region of secondary transform, embodiments of the present invention check a position of a last significant coefficient for each considered transform block. A secondary transform index is adaptively signaled for a current CU according to the position(s) of the last significant coefficient(s) in one or more considered TBs within the current CU. Some examples of the considered TUs are all TBs in the current CU, only luma TBs in the current CU, only chroma TBs in the current CU, only TBs with significant coefficients in the current CU, a predefined subset of TBs in the current block, or all TBs except for those not allowed for secondary transform. The TBs not allowed for secondary transform include any TB with a TB width or TB height less than 4 samples or any TB processed by transform skip. If there is no considered TB in the current block, secondary transform is not applied to any TB in the current block. For example, the video encoder skips signaling the secondary transform index if the position of the last significant coefficient in any considered TB is within a predefined region (e.g. zero-out region of secondary transform where all coefficients are set to zero after secondary transform) in this embodiment. The video decoder infers secondary transform is not applied to a current CU when a position of a last significant coefficient in any considered TB within the current CU is located in the predefine region. In one embodiment, the predefined region includes CG 1, CG 2, or CG 3 of the current transform block. The video decoder thus infers secondary transform is not applied to a current CU when a position of a significant coefficient in any considered transform block within the current CU is in CG 1, CG 2, or CG 3, as all coefficients in CG 1, CG 2, and CG 3 are set to zero after secondary transform. In another embodiment, the predefined region includes the entire TB except for a top-left 4×4 subblock, or the predefined region includes those coefficient positions with position indices in a TB larger than 15 assuming the position index ranging from 0 and the processing order is diagonal scanning for the whole TB. In another embodiment, the predefined region includes the entire TB except for the first 8 coefficient positions, or the predefined region includes those coefficient positions with position indices in a TB larger than 7 assuming the position index ranging from 0 and the processing order is diagonal scanning for the whole TB. In the preferred embodiments of the present invention, according to a position of a last significant coefficient in each considered TB, secondary transform is inferred to be disabled without any syntax signaling, which means a secondary transform index will not be signaled at the encoder and the secondary transform index will not be parsed at the decoder. For example, the video decoder infers a corresponding secondary transform index for a current CU to be zero without parsing the secondary transform index from the video bitstream when a position of a last significant coefficient of any considered transform block within the current CU is in a predefined region of secondary transform in the transform block.

In one embodiment, coefficients in second, third, fourth coding groups CG 1, CG 2, and CG 3 of the top-left 8×8 region are set to zero after secondary transform. In another embodiment, all transform coefficients except for the top-left 4×4 subblock are set to zero after secondary transform. In another embodiment, when the predefined region refers to a zero-out region of secondary transform, the predefined region varies according to the TB width or TB height. For example, if the TB width is equal to the TB height and the TB width is equal to 4 or 8, RST 8×N where N=16, 48, or 64, is applied to the TB as introduced and then the coefficients after secondary transform are zero if the position index in the TB is larger than 7. In this example, the predefined region includes those coefficient positions with the position indices in a TB larger than 7 assuming the position index ranging from 0 and the processing order is diagonal scanning for the whole TB. In another example, if RST 16×N where N=16, 48, or 64, is applied to the TB as introduced and then the coefficients after secondary transform are zero if the position index in the TB is larger than 15. In this example, the predefined region includes those coefficient positions with the position indices in a TB larger than 15 assuming the position index ranging from 0 and the processing order is diagonal scanning for the whole TB. According to these embodiments, secondary transform is not applied when a position of a last significant coefficient for any considered transform block is in any of second, third, and fourth coding groups CG 1, CG 2, and CG 3 in a top-left 8×8 region of the transform block, when the position of the last significant coefficient of any considered transform block is not in the first coding group CG 0 in the top-left 8×8 region, or when a position of a last significant coefficient of any considered transform block is in the predefined region. In the decoder, after parsing of a last significant coefficient position for each considered transform block in the current CU, a secondary transform index is inferred to be zero when a position of a last significant coefficient for any considered transform block is in a top-left 8×8 region except for a first coding group CG 0, the entire transform block except for a first coding group CG 0, or the predefined region. The encoder in this embodiment adaptively skips signaling a secondary transform index for a current CU according to a position of a last significant coefficient of each considered TB within the current CU and the predefined position, and the decoder infers inverse secondary transform is disabled for the current CU according to the positions of the last significant coefficients of the considered TBs within the current CU and the predefined position. For example, inverse secondary transform is disabled by inferring a secondary transform index for a current CU to be zero when a position of a last significant coefficient for any considered TB falls in the predefined region such as a coding group other than the first coding group in a TB. The encoder in one embodiment only signals a secondary transform index when all position of last significant coefficients in the considered transform blocks are not in the predefined region. Similarly, the decoder in this embodiment only parses a secondary transform index when all positions of last significant coefficients in the considered transform blocks are not in the predefined region; otherwise the decoder infers inverse secondary transform is disabled for the transform block or the entire CU. The decoder determines the position of the last significant coefficient in a transform block by parsing last significant coefficient position syntax at the TB level.

In some of the above embodiments, one or more syntax elements related to residual coding for some predefined coding groups in a transform block do not need to be signaled when secondary transform is applied to the transform block. For example, these syntax elements related to residual coding for some predefined coding group in one or more transform blocks parsed after the current block are always equal to zero when secondary transform is applied to the transform block, therefore, these syntax elements related to residual coding are not signaled in a video bitstream nor parsed from the video bitstream when a secondary transform index is larger than zero. After applying secondary transform, coefficients in some coding groups are all set to zero, which implies some particular syntax elements related to residual coding, such as the significant flag for these coding groups, do not need to be signaled. In one example, coefficients in the second, third, and fourth coding groups CG 1, CG 2, and CG 3 as well as the region outside the top-left 8×8 region are set to zero after secondary transform. FIG. 5 illustrates an example of a 16×16 transform block within a 16×16 CU. Each 4×4 sub-block in the 16×16 transform block is a coding group. The coding groups within the top-left 8×8 region are denoted as CG 0, CG 1, CG 2, and CG 3, and the corresponding significant flags for these coding groups are denoted as SigFlag_(CG0), SigFlag_(CG1), SigFlag_(CG2), and SigFlag_(CG3). If secondary transform is applied, a 16×48 matrix is selected in the secondary transform operation to transform the first 48 primary transform coefficients in the top-left 8×8 region of this 16×16 transform block into 16 secondary transform coefficients. Coefficients in the transform block except for the first coding group CG 0 are set to zero after secondary transform according to one embodiment, so the significant flags SigFlag_(CG1), SigFlag_(CG2), and SigFlag_(CG3) for CG 1, CG 2, and CG 3, as well as the significant flags for the region outside the top-left region, are not signaled at the encoder side and are inferred to be false at the decoder side according to this embodiment.

Secondary Transform Signaling Depend on Comparing Last Significant Coefficient Position with Threshold In some embodiments of the present invention, secondary transform syntax is conditionally signaled in a video bitstream depending on one or more comparison results from one or more Transform Blocks (TBs) within a CU. One comparison includes checking a position of a last significant coefficient in a TB with a predefined position. In some embodiments, secondary transform syntax is conditionally signaled in a video bitstream only depending on comparison results from considered TBs within a current CU. For example, all TBs in the current CU are the considered TBs. In another example, only luma TBs in the current CU are the considered TBs. In another example, only the TBs with significant coefficients in the current CU are the considered TBs. In another example, the considered TBs can be any subset of TBs in the current CU. In another example, in the current CU, the TBs, except for those not allowed for secondary transform, are the considered TBs. For example, a TB is not allowed for secondary transform if a TB width or TB height is smaller than 4, or a TB is not allowed for secondary transform if it is processed by transform skip. When the comparison results for all considered TBs do not satisfy the signaling condition of secondary transform, secondary transform is inferred as disabled for the current CU and a secondary transform index is not signaled in the video bitstream. When there is no considered TB within the current CU, the secondary transform index is not signaled as secondary transform is disabled for the current CU. An example of setting the signaling condition of secondary transform is when the position of the last significant coefficient for a TB is larger than a predefined position. If the positions of the last significant coefficients for all considered TBs in the current CU are smaller than or equal to the predefined position, the secondary transform index for the current CU is not signaled. The 16×16 CU containing only one 16×16 transform block shown in FIG. 7 may be used to illustrate some examples of deciding whether a secondary transform index is signaled according to a position of a last significant coefficient in the 16×16 transform block. Assume that this 16×16 transform block is a considered TB in the current 16×16 CU. In the following embodiments, the secondary transform index is signaled at a CU level, or after the signaling of residual coding syntax for all TBs in the current CU, whereas the secondary transform index may be signaled at a TU, TB level, or after signaling the residual coding syntax including positions of the last significant coefficients for one or more TBs in the current CU in some other embodiments and if the secondary transform is signaled at TU, TB level, or after signaling the residual coding syntax including positions of the last significant coefficients for one or more TBs in the current CU, the considered TBs are within the current TU, current TB or the TBs signaling before the current TB. In other embodiments, the secondary transform index for a current CU is signaled after one or more luma TBs in the current CU, or is signaled after a first non-zero TB in the current CU, or is signaled after a first TB in the current CU.

The decoder parses last significant coefficient position syntax for each TB of a CU from the video bitstream, and determines the position of the last significant coefficient for each TB based on the parsed the last significant coefficient position syntax. For example, the last significant coefficient position syntax includes last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. The position of the last significant coefficient is compared with a predefined position, such as (0,0), and the decoder infers the secondary transform index as zero if the position of the last significant coefficient is equal to (0,0).

Separate secondary transform indices may be signaled for luma and chroma CB/CU. In this embodiment, for one luma CB and two chroma CBs coded in separate splitting trees, one secondary transform index is conditionally signaled for the luma CB depending on one or more luma TBs in the luma CB and another secondary transform index is conditionally signaled for the chroma CB depending on one or more chroma TBs in the chroma CB. In an alternative embodiment, only one secondary transform index is signaled for each CU, and one or both the luma and chroma TBs use the secondary transform index, for example, the secondary transform index is conditionally signaled for one or more luma TBs according to a position of a last significant coefficient in each luma TB or any subset of luma TBs, and the chroma TBs reuse the secondary transform index. In another example, the secondary transform index is conditionally signaled for one or more luma TBs according to positions of last significant coefficients in the luma and chroma TBs. In this embodiment, for a current CU coded in a shared splitting tree, one secondary transform index is conditionally signaled for the current CU, and secondary transform or inverse secondary transform is applied to one or both of luma and chroma TBs according to the secondary transform index. For example, if secondary transform is only applied to the luma TBs, the secondary transform index of the current CU is conditionally signaled depending on the luma and chroma TBs in the current CU. In one embodiment, the secondary transform index is larger than zero if secondary transform is applied to the 16×16 TU within the 16×16 CU, and the secondary transform index is set to zero if secondary transform is not applied to the 16×16 TU. In the following embodiments, the encoder adaptively skips signaling a secondary transform index according to comparison results from the considered TBs in a CU. Similarly, the decoder adaptively infers secondary transform is not applied to the transform block according to comparison results from the considered TBs in a CU.

As shown in FIG. 7, there are four 4×4 coding groups in a top-left 8×8 region of the 16×16 transform block, including a first coding group CG 0, a second coding group CG 1, a third coding group CG 2, and a fourth coding group CG 3. The corresponding significant flags for CG 0, CG 1, CG 2, and CG 3 are denoted as SigFlag_(CG0), SigFlag_(CG1), SigFlag_(CG2), and SigFlag_(CG3). If secondary transform is applied to this 16×16 transform block, a 16×48 matrix is used to transform 48 primary transform coefficients of the top-left 8×8 region in the 16×16 transform block into 16 secondary transform coefficients. The 16 secondary transform coefficients replace the primary transform coefficients in the first coding group CG 0 of the top-left 8×8 region in the 16×16 transform block. Coefficients in CG 1 and CG 2 or coefficients in CG 1, CG 2, and CG 3 or the TB except for CG1 (the first 16 secondary transform coefficients) are set to zero after secondary transform. A region with all transform coefficients set to zero after secondary transform is represented as a zero-out region of secondary transform. If there is any significant coefficient located in the zero-out region of secondary transform, secondary transform is inferred to be disabled. The term coefficients or transform coefficients in the description refers to final coefficients delivered to a quantization process at the encoder or final coefficients received after a dequantization process at the decoder. In some embodiments, if the positions of the last significant coefficients in the considered TBs of a current CU are all smaller than or equal to the predefined position in a processing order, the secondary transform index for the current CU is not signaled at the encoder and inverse secondary transform for the current CU is inferred as disabled at the decoder. The encoder compares the positions of the last significant coefficients in the considered TBs in a current CU with the predefined position in a processing order. If the positions of the last significant coefficients in the considered TBs are all smaller than or equal to the predefined position in a processing order, the encoder skips signaling the secondary transform index for the current CU, otherwise, the encoder signals the secondary transform index based on other existing conditions. The decoder also compares the positions of the last significant coefficients for the considered TBs of a current CU with the predefined position in a processing order. The decoder parses the secondary transform index if the position of the last significant coefficient in at least one considered transform block is larger than the predefined position; otherwise inverse secondary transform is inferred to be disabled for the transform block. In this embodiment, the processing order may be a diagonal scanning order for a transform block, within each coding group, and/or across all coding groups in a transform block. An example of the processing order for a 16×16 transform block is from a top-left 8×8 region, a bottom-left 8×8 region, a top-right 8×8 region, to a bottom-right 8×8 region, and within each 8×8 region of the 16×16 transform block, the processing order is from a top-left coding group, a bottom-left coding group, a top-right coding group, to a bottom-right coding group, and within each coding group, the processing order is a diagonal scanning order. Another example of the processing order for a 16×16 transform block is from the top-left coefficient to the bottom-left coefficient, as shown in FIG. 10.

In the above embodiments, an example of the predefined position is a first position in a transform block, which contains the DC value in the transform block, such as position 0. In this embodiment, a secondary transform index is not signaled for a current block as secondary transform cannot be applied if there are only DC values in all considered transform block(s) within the current block (which means the positions of last significant coefficients for all considered TB s are at the first position in a TB). The current block is a CU, CB, or a TU. The secondary transform index is only signaled when a position of the last significant coefficient for at least one of the considered TBs is not equal to the first position in the transform block, which implies there is at least one non-DC value in at least one considered transform block. For example of a CU containing one TB, if a position of a last significant coefficient is at position C as shown in FIG. 7, which is within the first coding group CG 0 but larger than the first position in CG 0, the encoder signals a secondary transform index for the 16×16 CU and the decoder parses the secondary transform index from the video bitstream. In another example, if a position of a last significant coefficient is at position D as shown in FIG. 7, which is the first position in the first coding group CG 0, the encoder skips signaling a secondary transform index for the 16×16 CU and the decoder infers inverse secondary transform is not applied to the TU within the 16×16 CU. In this example, there is only a DC value in the transform block and applying secondary transform to this transform block will not bring additional coding gain, so secondary transform is disabled and secondary transform syntax is not signaled. Another embodiment of the predefined position is a fixed position (x,y) in a first coding group of a top-left 8×8 region, where x and y can be integers selecting from 0, 1, 2, 3, . . . to (a maximum coding group size−1). For example, the fixed position (x,y) is (0,1), (1,0), or (1,1) in the first coding group CG 0 of a top-left 8×8 region within the transform block. Another example of the predefined position in CG 0 is determined by a fixed scanning order, for example, the first, second, third, fourth, to (a maximum coding group size−1)^(th) position in the first coding group CG 0 according to a fixed scanning order. An example of the fixed scanning order is a diagonal scanning order.

Some embodiments of the present invention also check if a number of non-zero coefficients in a first coding group CG 0 of the 16×16 transform block is larger than a predefined number, and the encoder or decoder only signals or parses a secondary transform index when the number of non-zero coefficients in CG 0 is larger than the predefined number. If the number of non-zero coefficients in CG 0 is less than or equal to the predefined number, secondary transform is not applied to the transform block according to this embodiment. The encoder skips signaling a secondary transform index for a current CU when a number of non-zero coefficients in CG 0 of the transform block within the current CU is smaller than or equal to the predefined number. Some examples of the predefined number are 1, 2, 3, and 4. In an embodiment, the encoder signals the secondary transform index if a position of the last significant coefficient is larger than a predefined position or if the number of non-zero coefficients in a first coding group of a top-left 8×8 region is larger than a predefined number and the position of the last significant coefficient is within the first coding group, otherwise the encoder skips signaling the secondary transform index. Some examples of the predefined position are the 64^(th) position and 48^(th) position, and an example of the predefined number is 1. In an embodiment of enabling secondary transform for a current CU containing multiple TUs, secondary transform may only be applied when a number of non-zero coefficients in CG 0 of all the TUs are larger than the predefined number. For example, a secondary transform index is not signaled nor parsed if each transform block in a current CU contains less than or equal to one non-zero coefficient.

In some other embodiments, a number of non-DC values in the considered transform blocks within a CU is determined and compared with a predefined number to decide secondary transform signaling, for example, secondary transform is only applied when there is at least one non-DC transformed value in at least one considered transform block within a CU. In this embodiment, a secondary transform index is signaled when there is at least one non-DC transformed value in at least one considered transform block within a CU at the encoder. Similarly, the decoder only parses a secondary transform index when there is at least one non-DC transformed value in at least one considered transform block within a CU. The decoder disables inverse secondary transform for TBs within a current CU by inferring a secondary transform index to be zero without parsing the secondary transform index when all TBs in the current CU contain only DC coefficients. In one embodiment, the secondary transform index is signaled or parsed if a position of the last significant coefficient for at least one considered transform block within a CU is larger than a predefined position or if a number of non-DC values in at least one considered transform block within a CU is larger than a predefined number and/or the position of the last significant coefficient is within the first coding group CG 0 of a top-left 8×8 region in each considered transform block within a CU. An example of the predefined number is 0 and some examples of the predefined position are the first position in the transform block. In an embodiment of setting the predefined number to be 0, the number of non-DC values may also be derived from the positions of the last significant coefficients or the last significant coefficient position syntax for the considered TBs, that is the number of non-DC values is larger than the predefined number (e.g. equal to 0) if the position of the last significant coefficient for at least one considered TBs is larger than the first position of the transform block. This embodiment is equivalent to signaling or parsing a secondary transform index when positions of last significant coefficients for at least one considered TBs are larger than a predefined position or when the positions of the last significant coefficients for at least one considered TBs are within a first coding group except for a first position of the first coding group.

Exemplary System Block Diagram Embodiments of the previously described video processing method are implemented in video encoders, video decoders, or both the video encoders and decoders. For example, the video processing method is implemented in an entropy coding module in the video encoder or in an entropy decoding module in the video decoder. Alternatively, the video processing method is implemented in a circuit integrated to the entropy coding module in the video encoder or video decoder. FIG. 8 illustrates an exemplary system block diagram for a Video Encoder 800 implementing various embodiments of the video processing method. A Block Structure Partitioning module 810 in the Video Encoder 800 receives input data of video pictures and determines a block partitioning structure for each video picture to be encoded. Each leaf coding block in the current video picture is predicted by Intra prediction in an Intra Prediction module 812 or Inter prediction in an Inter Prediction module 814 to remove spatial redundancy or temporal redundancy. The Intra Prediction module 812 provides intra predictors for the leaf coding block based on reconstructed video data of the current video picture. The Inter Prediction module 814 performs Motion Estimation (ME) and Motion Compensation (MC) to provide inter predictors for the leaf coding block based on video data from other video picture or pictures. A Switch 816 selects either the Intra Prediction module 812 or Inter Prediction module 814 to supply the predictor to an Adder 818 to form prediction errors, also called residuals. The residuals in each leaf coding block in the current video picture are divided into one or multiple transform blocks. A Transform (T) module 820 determines a transform operation for each transform block, and the transform operation includes one or both of primary transform and secondary transform. Some embodiments of the present invention disables secondary transform for the transform block if a width or height of the transform block is larger than a predefined threshold. The residuals of each transform block are processed by the Transform (T) module 820 followed by a Quantization (Q) module 822 to generate transform coefficient levels to be encoded by an Entropy Encoder 834. The Entropy Encoder 834 also encodes prediction information and filter information to form a video bitstream. The video bitstream is then packed with side information. The transform coefficient levels of the current transform block are processed by an Inverse Quantization (IQ) module 824 and an Inverse Transform (IT) module 826 to recover the residuals of the current transform block. As shown in FIG. 8, reconstructed video data are recovered by adding back the residuals to the selected predictor at a Reconstruction (REC) module 828. The reconstructed video data may be stored in a Reference Picture Buffer (Ref. Pict. Buffer) 832 and used by the Inter Prediction module 814 for prediction of other pictures. The reconstructed video data from the Reconstruction module 828 may be subject to various impairments due to the encoding processing, consequently, an In-loop Processing Filter 830 is applied to the reconstructed video data before storing in the Reference Picture Buffer 832 to further enhance picture quality.

A corresponding Video Decoder 900 for decoding the video bitstream generated by the Video Encoder 800 of FIG. 8 is shown in FIG. 9. The input to the Video Decoder 900 is decoded by an Entropy Decoder 910 to parse and recover transform coefficient levels of each transform block and other system information. A Block Structure Partitioning module 912 determines a block partitioning structure for each video picture. The decoding process of the Decoder 900 is similar to the reconstruction loop at the Encoder 800, except the Decoder 900 only requires motion compensation prediction in Inter Prediction module 916. Each leaf coding block in the video picture is decoded by either an Intra Prediction module 914 or an Inter Prediction module 916, and a Switch 918 selects an Intra predictor or Inter predictor according to decoded mode information. The transform coefficient levels associated with each transform block is then recovered by an Inverse Quantization (IQ) module 922 to generate final transform coefficients. An Inverse Transform (IT) module 924 applies an inverse transform operation to the final transform coefficients to recover residuals. The inverse transform operation includes one or both inverse secondary transform and inverse primary transform. Some embodiments of the present invention skips inverse secondary transform for a transform block in a current CU if a width or height of the current CU is larger than a predefined threshold. If the transform block has width and height smaller than or equal to the predefined threshold, the Inverse Transform (IT) module performs an inverse transform operation according to a secondary transform index parsed from the video bitstream. The recovered residuals are reconstructed by adding back the predictor in a Reconstruction (REC) module 920 to produce reconstructed video. The reconstructed video is further processed by an In-loop Processing Filter (Filter) 926 to generate final decoded video. If a currently decoded video picture is a reference picture, the reconstructed video of the currently decoded video picture is also stored in a Reference Picture Buffer 928 for later pictures in decoding order.

Various components of the Video Encoder 800 and Video Decoder 900 in FIG. 8 and FIG. 9 may be implemented by hardware components, one or more processors configured to execute program instructions stored in a memory, or a combination of hardware and processor. For example, a processor executes program instructions to control applying a transform operation or an inverse transform operation. The processor is equipped with a single or multiple processing cores. In some examples, the processor executes program instructions to perform functions in some components in the Encoder 800 and Decoder 900, and the memory electrically coupled with the processor is used to store the program instructions, information corresponding to the reconstructed data, and/or intermediate data during the encoding or decoding process. The memory in some embodiments includes a non-transitory computer readable medium, such as a semiconductor or solid-state memory, a Random Access Memory (RAM), a Read-Only Memory (ROM), a hard disk, an optical disk, or other suitable storage medium. The memory may also be a combination of two or more of the non-transitory computer readable mediums listed above. As shown in FIGS. 8 and 9, the Encoder 800 and Decoder 900 may be implemented in the same electronic device, so various functional components of the Encoder 800 and Decoder 900 may be shared or reused if implemented in the same electronic device. Any of the embodiments of the present invention may be implemented in a Transform module 820 of the Encoder 800, and/or an Inverse Transform module 924 of the Decoder 900. Alternatively, any of the embodiments may be implemented as a circuit coupled to the Transform module 820 of the Encoder 800 and/or the Inverse Transform module 924 of the Decoder 900, so as to provide the information needed by the Transform module 820 or the Inverse Transform module 924.

Embodiments of the video processing methods adaptively enable secondary transform may be implemented in a circuit integrated into a video compression chip or program code integrated into video compression software to perform the processing described above. For examples, applying a transform operation or an inverse transform operation may be realized in program codes to be executed on a computer processor, a Digital Signal Processor (DSP), a microprocessor, or Field Programmable Gate Array (FPGA). These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention.

Reference throughout this specification to “an embodiment”, “some embodiments”, or similar language means that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in an embodiment” or “in some embodiments” in various places throughout this specification are not necessarily all referring to the same embodiment, these embodiments can be implemented individually or in conjunction with one or more other embodiments. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention.

The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope. 

1-10. (canceled)
 11. A method of decoding video data in a video coding system, comprising: receiving a video bitstream carrying input data associated with a current block in a current video picture; decoding the input data associated with the current block to determine final transform coefficients of the current block; determining that a width or height of the current block is larger than a predefined threshold; determining an inverse transform operation for the current block, wherein the inverse transform operation excludes inverse secondary transform; applying the inverse transform operation to the final transform coefficients to recover residuals of the current block; and decoding the current block in the video picture based on the residuals of the current block.
 12. The method of claim 11, wherein a secondary transform index for the current block is inferred to be zero.
 13. The method of claim 11, wherein the current block is a Coding Unit (CU), and the step of determining an inverse transform operation further comprises determining the inverse transform operation excludes inverse secondary transform based on a number of TU(s) in the current block.
 14. The method of claim 13, wherein determining the transform operation excludes secondary transform when the number of TUs in the current block is larger than one.
 15. The method of claim 13, wherein the step of determining an inverse transform operation further comprises determining an auxiliary inverse transform operation for one selected TU within the current block and determining the transform operation for all other TUs, wherein the auxiliary inverse transform operation comprising inverse secondary transform and inverse primary transform, and the inverse transform operation comprising only inverse primary transform.
 16. The method of claim 15, wherein the selected TU within the current block is a last TU within the current block.
 17. The method of claim 11, wherein the predefined threshold is one of 16, 32, 64, 128 and 256 luma samples.
 18. The method of claim 11, wherein the predefined threshold is set according to a maximum TU size or a maximum TB size.
 19. The method of claim 18, wherein the maximum TU size or maximum TB size is specified by a coding standard; or the maximum TU size or maximum TB size is specified in a Sequence Parameter Set (SPS), Picture Parameter Set (PPS), tile, tile group, or slice level.
 20. The method of claim 11, further comprising parsing a secondary transform index only when both the width and height of a block are less than or equal to the predefined threshold, wherein the secondary transform index for the current block is inferred to be zero as the width or height of the current block is larger than the predefined threshold.
 21. The method of claim 11, further comprising parsing a secondary transform index but forcing the secondary transform index to be zero.
 22. The method of claim 11, wherein the current block is coded by intra prediction and secondary transform is disabled for non-intra coded blocks.
 23. An apparatus for performing video encoding, comprising: a computer processor configured for receiving video data; and programming executable on the computer processor for video coding by performing steps comprising: receiving input data associated with a current block in a current video picture; generating residuals of the current block by predicting the current block; determining that a width or height of the current block is larger than a predefined threshold; determining a transform operation for the current block, wherein the transform operation excludes secondary transform; applying the transform operation to the residuals of the current block to generate final transform coefficients; and encoding the current block in the video picture according to the final transform coefficients of the current block.
 24. An apparatus for performing video decoding, comprising: a computer processor configured for receiving video data; and programming executable on the computer processor for video coding by performing steps comprising: receiving a video bitstream carrying input data associated with a current block in a current video picture; decoding the input data associated with the current block to determine final transform coefficients of the current block; determining that a width or height of the current block is larger than a predefined threshold; determining an inverse transform operation for the current block, wherein the inverse transform operation excludes inverse secondary transform; applying the inverse transform operation to the final transform coefficients to recover residuals of the current block; and decoding the current block in the video picture based on the residuals of the current block. 